import java.awt.*;

/**
 * GraphAlgorithm.java
 * 
 * @author: Nhanntv
 * @date: November, 2011
 * 
 *        Applet for explaining graph algorithms. It currently only explains
 *        Dijkstra's shortest path algorithm, but it can easily be extended to
 *        handle more algorithms.
 * 
 *        Copyright 2011, Nhanntv, all rights reserved
 */

public class GraphAlgorithm extends java.applet.Applet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	GraphCanvas graphcanvas = new GraphCanvas(this); // Graphics Dijkstra
	Options options = new Options(this); // Option
	Documentation documentation = new Documentation(); // document instruction

	// Ham khoi tao
	public void init() {
		setSize(700, 500);
		setLayout(new BorderLayout(10, 10));
		add("Center", graphcanvas);
		add("North", documentation);
		add("East", options);
	}

	public void start() {
		super.start();
	}

	public Insets insets() {
		return new Insets(10, 10, 10, 10);
	}

	// Ham Lock
	public void lock() {
		graphcanvas.lock();
		options.lock();
	}

	// Ham Unlock
	public void unlock() {
		graphcanvas.unlock();
		options.unlock();
	}
}
